package com.nz2004.controller;

import com.nz2004.entity.RoleVO;
import com.nz2004.service.UserRoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class UserRoleController {
    @Autowired
    private UserRoleService userRoleService;

    @GetMapping("/queryRoleVO")
    @ResponseBody
    public RoleVO QueryRoleVO(Integer userId){
        RoleVO roleVO = userRoleService.queryRoleVO(userId);
        return roleVO;
    }

    @GetMapping("/cleanAndInsertRoles")
    @ResponseBody
    public Boolean cleanAndInsertRoles(Integer userId,Integer[] ids){
         return userRoleService.cleanAndInsertRoles(userId, ids);
    }
}
